Skip to content

libsql: Fix bootstrap error handling#2148

Merged
penberg merged 3 commits intomainfrom
fix-bootstrap-error-handling
Aug 26, 2025
Merged

libsql: Fix bootstrap error handling#2148
penberg merged 3 commits intomainfrom
fix-bootstrap-error-handling

Conversation

@penberg
Copy link
Copy Markdown
Collaborator

@penberg penberg commented Aug 26, 2025

This fixes the following issues:

  • If we fail to boostrap at database open, return an error instead of allowing local files to be in inconsistent state. Note that we ignored boostrap errors to avoid probing the remote for generation when offline, but that I fixed now in a different way.
  • If we have a database file, but no metadata, return an error instead of allowing inconsistent state.

In preparation for erroring database open if boostrap fails, make sure
sync_db_if_needed() is robust in offline mode and does not probe the
server if we already have a database and metadata files.
If boostrap fails in database open, we need to return an error;
otherwise we'll have the local database in inconsistent state.
…issing

This is an inconsistent state because there is no way for us to know
what generation the database file is tracking. For all we know, it could
be a totally unrelated database file than the one we have remotely.
Therefore, return an error.
@penberg penberg changed the title Fix bootstrap error handling libsql: Fix bootstrap error handling Aug 26, 2025
@penberg penberg added this pull request to the merge queue Aug 26, 2025
Merged via the queue into main with commit 8f7d444 Aug 26, 2025
19 checks passed
@penberg penberg deleted the fix-bootstrap-error-handling branch August 26, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants